'use client'
import { createContext, useContext } from 'react'

import { User } from '@/service/models/UserModel'

const UserContext = createContext<User>({} as User)

export function useUserContext() {
  return useContext(UserContext)
}

export function UserProvider({
  children,
  value,
}: {
  children: React.ReactNode
  value: User
}) {
  return <UserContext.Provider value={value}>{children}</UserContext.Provider>
}
